<?php 
$Page	= App::$Response->_page;
$Model 	= App::$Response->_model;

switch($Model->_dialog_type){
	case EDialogType::Error:
		$title = "Error!";
		break;
	case EDialogType::Message:
		$title = "Aviso";
		break;
}
	
?>

<script type="text/javascript">
$("#<?php echo EDivControl::$AlertIn;?>").html("<?php echo $Model->_message; ?>");
$("#<?php echo EDivControl::$Alert; ?>").dialog({
	autoOpen: true,
	modal: true,
	draggable: false,
	resizable: false,
	title: '<?php echo $title; ?>',
	buttons: { "Ok": function() { 
		$(this).dialog("close");
		<?php if($Model->_selected_item != null){ ?>
		$("#<?php echo $Model->_selected_item;?>").focus().select();
		<?php } ?>		 
	} },
	open: function(event, ui) { jQuery('.ui-dialog-titlebar-close').show(); }
});
</script>